import { EntitySchema } from 'typeorm'

export const Photo = new EntitySchema({
  name: 'Photo',
  columns: {
    id: {
      primary: true,
      type: 'int',
      generated: true
    },
    url: {
      type: 'varchar'
    }
  },
  relations: {
    user: {
      target: 'User',
      type: 'many-to-one',
      joinTable: true
    }
  }
})
